const express = require('express')
const app = express()
const port = process.env.PORT || 3001

const bodyParser = require('body-parser')
const cors = require('cors')

const apiRouter = require('./routes/apiRouter')

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

app.use(cors())

app.use('/api', [apiRouter])

app.listen(port, () => console.log(`listen: ${port}`))
